package cn.wolfcode.wolf2w.cloud.controller;

import cn.wolfcode.wolf2w.cloud.feign.UserInfoFeignApi;
import cn.wolfcode.wolf2w.cloud.msg.feign.ISmsFeignApi;
import cn.wolfode.wolf2w.cloud.commom.util.JsonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

//交给spring管理
@RestController
@RequestMapping("sms")
public class SmsController {

    @Autowired
    private UserInfoFeignApi userInfoFeignApi;

    @Autowired
    private ISmsFeignApi smsFeignApi;
    @GetMapping("/sendVerifyCode")
    public Object sendVerifyCode(String phone) {
        //调用msg-server服务接口进行短信发送
        JsonResult result = smsFeignApi.sendVerifyCode(phone);

        if (result==null){
            return  JsonResult.defaultError();
        }
        return result;
    }
}
